package com.wei.czz.framework.game.controller;

import java.util.List;

import com.wei.czz.common.annotation.Auth;
import com.wei.czz.common.dto.game.FlowDto;
import com.wei.czz.common.tool.Result;
import com.wei.czz.framework.game.service.GameUserService;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wei
 * date: 2023-03-16 11:37:17
 * className: GameUserFlowController 游戏用户变更流水请求接口类
 * version: 1.0
 * description:
 */
@RestController
@RequestMapping("/game-user-flow")
@AllArgsConstructor
public class GameUserFlowController {

    private static final Logger log = LoggerFactory.getLogger(GameUserFlowController.class);

    private GameUserService gameUserService;

    /**
     * 获取游戏用户流水列表接口
     * <p>
     * 调用方：
     *  1、浏览器-后台管理页-游戏用户管理页-游戏用户流水弹出框调用
     *
     * @param id 游戏用户主键
     * @return 游戏用户流水列表
     */
    @RequestMapping("/list")
    @Auth(permit = "game:user:get")
    public Result<List<FlowDto>> getGameUserFlowList(@RequestParam("id") Long id){
        log.info("开始获取游戏用户流水列表业务。id={}", id);

        List<FlowDto> flowDtoList = gameUserService.getGameUserFlowList(id);

        log.info("获取游戏用户流水列表业务结束");
        return Result.success(flowDtoList);
    }


}
